package com.sharp.demo.vo.portal.relation;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sharp.authorization.dao.common.entity.AcUser;
import com.sharp.kernel.config.db.key.SequenceGenId;
import com.sharp.kernel.config.db.key.UuidGenId;
import com.sharp.portal.constant.anno.PortalField;
import com.sharp.portal.constant.anno.PortalId;
import com.sharp.portal.constant.anno.PortalModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import java.util.Date;

/**
 * Title: AcUserVO
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2022/8/11 9:59
 */
@Data
@EqualsAndHashCode(callSuper = true)
@PortalModel(description = "用户", readOnly = false)
public class AcUserVO extends AcUser {
    @PortalId
    private String id;

    @JsonIgnore
    @ApiModelProperty(value = "密码")
    private String password;


    @JsonIgnore
    @ApiModelProperty(value = "openAPI key")
    private String appKey;

    @JsonIgnore
    @ApiModelProperty(value = "openAPI secret")
    private String appSecret;


    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "上次输错密码时间")
    private Date passwordErrorLastTime;

    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "上次密码修改时间")
    private Date passwordUpdateLastTime;

    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "上次登录时间")
    private Date lastLoginTime;

    @PortalField(dataType = PortalField.DataType.ENUM)
    @ApiModelProperty(value = "状态")
    private String status;


    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createAt;

    @PortalField(dataType = PortalField.DataType.DATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "修改时间")
    private Date updateAt;

    @PortalField(dataType = PortalField.DataType.ENUM)
    @ApiModelProperty(value = "有效性")
    private String valid;
}
